<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class Articles extends Model
{
    //一对多关系的函数
    public function hasManyCommments()
    {
        return $this->hasMany('App\Commments', 'article_id', 'id');
    }
}
